//
//  StudyTopicPageModel.m
//  TeacherNet
//
//  Created by slz on 2017/12/19.
//  Copyright © 2017年 bnsr. All rights reserved.
//

#import "StudyTopicPageModel.h"

/*
 "elite":0,
 "id":0,
 "name":"寂寞吗",
 "question_content":"",
 "question_time":"",
 "reply_times":0,
 "stick":0,
 "title":"测试课程20171012",
 "username":"",
 "watch_times":1
 */

@implementation StudyHomeWorkOrExamModel
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"classId" : @"class_id",
             @"classHourId":@"course_hour_id",
             @"courseId":@"course_id",
             @"courseName":@"name",
             @"scoreState":@"score",
             @"time":@"time",
             @"title":@"title",
             @"hourTitle":@"hour_title",
             @"watchTime":@"watch_times",
             @"topicId":@"id",
             @"noteName":@"name",
             @"scoreFloat":@"score"
             };
}

- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {

    if ([[_scoreState lowercaseString] isEqualToString:@"null"]){
        _scoreState = @"不合格";
    }
    return YES;
}

@end

@implementation StudyTopicPageModel
+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"homeworkOrExamList" : [StudyHomeWorkOrExamModel class],
             @"noteList":[StudyHomeWorkOrExamModel class],
             @"topicList":[StudyHomeWorkOrExamModel class]
             };
}
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"homeworkOrExamList" : @"examViews",
             @"noteList":@"noteViews",
             @"topicList":@"topicViews"
             };
}
@end
